package com.zs.admin.crontab;


import com.zs.admin.service.wisdbook.IWisdbookAsyncService;
import com.zs.common.util.YmlUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;


/**
 * 具体的定时任务
 */
@Component("myJob")
public class MyJob  {

    private static final Logger log = LoggerFactory.getLogger(MyJob.class);

    @Autowired
    IWisdbookAsyncService iWisdbookAsyncService;

    @Scheduled(cron = "0 */1 * * * ?")
    public void pdf_toPageImg() {
        String profiles = YmlUtils.get("spring.profiles.active");
        if(profiles.equals("dev")) {
            log.info("----------每分钟检测是否有pdf需要转页图-------" + profiles);
            iWisdbookAsyncService.executePdfToPageImg();
        }
    }

}
